package com.isunland.managesystem.ui;

import android.support.v4.app.Fragment;
import com.isunland.managesystem.R;
import com.isunland.managesystem.base.BasePagerActivity;
import com.isunland.managesystem.entity.Message;

public class MessageDetailPagerActivity extends BasePagerActivity {
  private int[] mTitleId = {
      R.string.sendMessageDetail, R.string.replyList
  };
  private long mId;

  @Override protected Fragment createFragmentOne() {
    int type = getIntent().getIntExtra(MessageDetailFragment.EXTRA_TYPE,
        MessageDetailFragment.VALUE_RECEIVE);
    Message message =
        (Message) getIntent().getSerializableExtra(MessageDetailFragment.EXTRA_MESSAGE);
    if (message != null) {
      mId = message.getId();
    }
    return MessageDetailFragment.newInstance(message, type);
  }

  @Override protected Fragment createFragmentTwo() {
    // Auto-generated method stub
    return new MessageReplyListFragment().newInstance(mId);
  }

  @Override protected int[] createTitle() {
    // Auto-generated method stub
    return mTitleId;
  }
}
